# -*- coding: utf-8 -*-
# @Time : 2018/12/31 21:29
# @Author : Administrator
# @File : loginTest.py
# @Project : 4.Python
# @title : 测试登录
from locust import HttpLocust,TaskSet,task

class UserBehavior(TaskSet):
    def on_start(self):
        self.index = 0
        self.loginData = ['lm','liuchan','dy','wangwu','admin']

    @task
    def testUser(self):
        print("---- index:"+str(self.index))
        print("---- data:"+self.loginData[self.index])
        self.index = (self.index + 1) % len(self.loginData)

class WebsiteUser(HttpLocust):
    task_set = UserBehavior
    min_wait = 1000
    max_wait = 3000
